package com.yumeng.common.utils;

import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;

/**
 * i18n资源文件
 *
 * @author wxd
 * @date 2024/5/28 下午4:28
 */
public class MessageUtils {

    public static String getLocalMessage(String code, Object... args){
        MessageSource source = SpringUtils.getBean(MessageSource.class);
        return source.getMessage(code, args, LocaleContextHolder.getLocale());
    }

}
